/*    */ package com.alipay.util;
/*    */ 
/*    */ import com.alipay.config.AlipayConfig;
/*    */ import java.io.BufferedReader;
/*    */ import java.io.InputStreamReader;
/*    */ import java.net.HttpURLConnection;
/*    */ import java.net.URL;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class AlipayNotify
/*    */ {
/*    */   public static String GetMysign(Map Params, String key)
/*    */   {
/* 19 */     Map sParaNew = AlipayFunction.ParaFilter(Params);
/* 20 */     String mysign = AlipayFunction.BuildMysign(sParaNew, key);
/*    */ 
/* 22 */     return mysign;
/*    */   }
/*    */ 
/*    */   public static String Verify(String notify_id)
/*    */   {
/* 36 */     String transport = AlipayConfig.transport;
/* 37 */     String partner = AlipayConfig.partner;
/* 38 */     String veryfy_url = "";
/* 39 */     if (transport.equalsIgnoreCase("https"))
/* 40 */       veryfy_url = "https://www.alipay.com/cooperate/gateway.do?service=notify_verify";
/*    */     else {
/* 42 */       veryfy_url = "http://notify.alipay.com/trade/notify_query.do?";
/*    */     }
/* 44 */     veryfy_url = veryfy_url + "&partner=" + partner + "&notify_id=" + notify_id;
/*    */ 
/* 46 */     String responseTxt = CheckUrl(veryfy_url);
/*    */ 
/* 48 */     return responseTxt;
/*    */   }
/*    */ 
/*    */   public static String CheckUrl(String urlvalue)
/*    */   {
/* 61 */     String inputLine = "";
/*    */     try
/*    */     {
/* 64 */       URL url = new URL(urlvalue);
/* 65 */       HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();
/*    */ 
/* 67 */       BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
/*    */ 
/* 69 */       inputLine = in.readLine().toString();
/*    */     } catch (Exception e) {
/* 71 */       e.printStackTrace();
/*    */     }
/*    */ 
/* 74 */     return inputLine;
/*    */   }
/*    */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.alipay.util.AlipayNotify
 * JD-Core Version:    0.6.0
 */